#ifndef LUA_GLFONT_H
#define LUA_GLFONT_H
	#include <luaFont/config.h>
	#include <boost/shared_ptr.hpp>
	#include <boost/array.hpp>
	class FTFont;
	class
	LUA_Font_EXPORT_API
		GLFONT
	{
	public:
		GLFONT(void);
		GLFONT(std::shared_ptr<FTFont> font)
			:ftFont_(font)
		{
		}
		~GLFONT(void);
	public:
		/**
			 * Set the char size for the current face.
			 *
			 * @param size      the face size in points (1/72 inch)
			 * @param res       the resolution of the target device.
			 * @return          <code>true</code> if size was set correctly
		*/
		bool FaceSize(const unsigned int size,
								  const unsigned int res = 72);

			/**
			 * Get the current face size in points (1/72 inch).
			 *
			 * @return face size
			 */
		unsigned int FaceSize() const;

		  /**
			 * Set the extrusion distance for the font. Only implemented by
			 * FTExtrudeFont
			 *
			 * @param depth  The extrusion distance.
			 */
			void Depth(float depth);

			/**
			 * Set the outset distance for the font. Only implemented by
			 * FTOutlineFont, FTPolygonFont and FTExtrudeFont
			 *
			 * @param outset  The outset distance.
			 */
			void Outset(float outset);

			/**
			 * Set the front and back outset distances for the font. Only
			 * implemented by FTExtrudeFont
			 *
			 * @param front  The front outset distance.
			 * @param back   The back outset distance.
			 */
			void Outset(float front, float back);

			/**
			 * Enable or disable the use of Display Lists inside FTGL
			 *
			 * @param  useList <code>true</code> turns ON display lists.
			 *                 <code>false</code> turns OFF display lists.
			 */
			void UseDisplayList(bool useList);

			/**
			 * Get the global ascender height for the face.
			 *
			 * @return  Ascender height
			 */
			float Ascender() const;

			/**
			 * Gets the global descender height for the face.
			 *
			 * @return  Descender height
			 */
			float Descender() const;

			/**
			 * Gets the line spacing for the font.
			 *
			 * @return  Line height
			 */
			float LineHeight() const;

			/**
			 * Get the bounding box for a string (deprecated).
			 *
			 * @param string  A char buffer.
			 * @param llx  Lower left near x coordinate.
			 * @param lly  Lower left near y coordinate.
			 * @param llz  Lower left near z coordinate.
			 * @param urx  Upper right far x coordinate.
			 * @param ury  Upper right far y coordinate.
			 * @param urz  Upper right far z coordinate.
			 */
			void BBox(const char* string, float& llx, float& lly, float& llz,
					  float& urx, float& ury, float& urz) const;
	public:
		void Font(std::shared_ptr<FTFont> ftFont) { ftFont_ = ftFont;}
		std::shared_ptr<FTFont> Font() { return ftFont_; }
	public:
		void renderText(double,double,double,const char*) const;
		void renderText(double x,double y, double z, const char* str,int haligned, int valigned) const;

		void renderTextOnScreenCoord(double x,double y,const char* str) const;
		void renderText(double,double,double,const std::string&) const;

		void renderText(double,double,double,const std::string&,int haligned, int valigned) const;
		void renderTextOnScreenCoord(double x,double y,const std::string&) const;
		void renderTextOnScreenCoord(double x,double y,const std::string&,int haligned, int valigned) const;
	private:
		std::shared_ptr<FTFont> ftFont_;
	};

	LUA_Font_EXPORT_API GLFONT CreateFTBitmapFont(const char*,int,float,float );
	LUA_Font_EXPORT_API GLFONT CreateFTBufferFont(const char*,int,float,float  );
	LUA_Font_EXPORT_API GLFONT CreateFTExtrudeFont(const char*,int,float ,float );
	LUA_Font_EXPORT_API GLFONT CreateFTOutlineFont(const char*,int,float,float  );
	LUA_Font_EXPORT_API GLFONT CreateFTPixmapFont(const char*,int,float,float  );
	LUA_Font_EXPORT_API GLFONT CreateFTPolygonFont(const char*,int,float,float  );
	LUA_Font_EXPORT_API GLFONT CreateFTTextureFont(const char*,int,float,float  );
#endif
